#include <bits/stdc++.h>
using namespace std;
set<int> numx;
set<int> numy;
using LL = long long;
int main() {
  LL r, c, n;
  cin >> r >> c >> n;
  for (int i = 1; i <= n; i++) {
    LL x, y;
    cin >> x >> y;
    numx.insert(x);
    numy.insert(y);
  }
  LL rr = numx.size(); // 统计多少行受控制
  LL cc = numy.size(); // 统计多少列受控制
  cout << rr * c + cc * r - rr * cc;
  return 0;
}